/***********************************************************************
 * Module:  Test.java
 * Author:  Administrator
 * Purpose: Defines the Class Test
 ***********************************************************************/

package com.feng.demo.hibernate.jta.model;


/** liubingzhao
 * @pdOid ec2848aa-1e87-4b83-b763-6aa84adb621d */
public class Test implements java.io.Serializable {
   /** @pdOid 341c7104-e2aa-4c58-9201-f13854d0dde5 */
   public long id;
   /** @pdOid 49c404ab-0af1-47eb-adcd-6a04e7b54c37 */
   public java.lang.String name;
   
   /**
    * Empty constructor which is required by Hibernate
    *
    */
   public Test() {
      // TODO Auto-generated constructor stub
   }
   
   /**
    * Get value of id
    *
    * @return id 
    */
   public long getId()
   {
      return id;
   }
   
   /**
    * Set value of id
    *
    * @param newId 
    */
   public void setId(long newId)
   {
      this.id = newId;
   }
   
   /**
    * Get value of name
    *
    * @return name 
    */
   public java.lang.String getName()
   {
      return name;
   }
   
   /**
    * Set value of name
    *
    * @param newName 
    */
   public void setName(java.lang.String newName)
   {
      this.name = newName;
   }
   
   /**
    * Get value of testPK.
    *
    * @return testPK object
    */
   public TestPK getTestPK() {
      return new TestPK(id);
   }
   
   /**
    * Set value of testPK.
    * 
    * @param pk
    */
   public void setTestPK(TestPK pk) {
      if (pk != null) {
         this.id = pk.getId();
      }
   }
   
   /* (non-Javadoc)
    * @see java.lang.Object#equals(java.lang.Object)
    */
   public boolean equals(Object other) {
   
      if (other == null)
         return false;
      
      if (other == this)
         return true;   
   
      if (!(other instanceof Test))
         return false;
   
      Test cast = (Test) other;
   
      if (this.id != cast.getId())
         return false;
   
      if (this.name == null ? cast.getName() != this.name : !this.name.equals( cast.getName()))
         return false;
   
      return true;
   }
   
   /* (non-Javadoc)
    * @see java.lang.Object#hashCode()
    */
   public int hashCode() {
      int hashCode = 0;
      if (this.name != null) 
         hashCode = 29 * hashCode + name.hashCode();
      return hashCode;
   }
   
   /* (non-Javadoc)
    * @see java.lang.Object#toString()
    */
   public String toString()
   {
      StringBuffer ret = new StringBuffer();
      ret.append( "com.feng.baseframe.Test: " );
      ret.append( "id='" + id + "'");
      ret.append( "name='" + name + "'");
      return ret.toString();
   }

}